#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n = 0;
    cin >> n;
    vector<vector<int>> arr(n, vector<int>(2));

    for (int i = 0; i < n; ++i)
    {
        for (int j = 0; j < 2; ++j)
        {
            cin >> arr[i][j];
        }
    }

    for (int i = 0; i < n - 1; ++i)
    {
        int mini = min(arr[i][0], arr[i][1]);
        int maxi = max(arr[i][0], arr[i][1]);
        for (int j = i + 1; j < n; ++j)
        {
            int minj = min(arr[j][0], arr[j][1]);
            int maxj = max(arr[j][0], arr[j][1]);
            if ((mini > minj && mini < maxj && maxi > maxj) || (mini < minj && maxi < maxj && maxi > minj))
            {
                cout << "Yes" << endl;
                goto end;
            }
        }
    }
    cout << "No" << endl;
end:;
    return 0;
}